/**
 * @file caidan.c
 * @brief       菜单文件
 * @version     0.1
 * @date        2023
 * 
 * @copyright   Copyright © 2025 by JinChengLong 
 * 
 * All rights reserved.
 * Unauthorized copying, reproduction, or redistribution of this file via any medium is strictly prohibited.  
 * Proprietary and confidential.
 *   
 */
#include "caidan.h"


uint32_t condem,ass,i,j=0;

uint8_t mima[4]={0,0,0,0},ma[4];

int16_t conde1,conde2,conde0;

/**
 * @brief 主界面面板
 * 
 */
void zhujiemian_mianban(void)
{
	
	conde_one();
	if(conde != condem )
	{
		 ass=RTC_GetCounter()+20;
	}
	Delay_ms(10);
	
	switch(conde)
	{
		
		case 4:	
				LCD_ShowChinese(18,148,"设置",RED,WHITE,12,1);	
				LCD_ShowChinese(53,148,"菜单",WHITE,WHITE,12,1);	
				LCD_ShowChinese(88,148,"管理",WHITE,WHITE,12,1);	
				LCD_DrawRectangle(50,118,80,146, WHITE);
//				LCD_DrawRectangle(85,118,115,146,WHITE);
//				Delay_us(10);         
//				LCD_DrawRectangle(15,118,45,146,  RED);   
//	
		break ;
		case 8:
//				LCD_DrawRectangle (15,118,45,146,  WHITE );			        
//				LCD_DrawRectangle(85,118,115,146,WHITE);
//					Delay_us(10);             
//				LCD_DrawRectangle (50,118,80,146,  RED) ;
				LCD_ShowChinese(18,148,"设置",WHITE,WHITE,12,1);	
				LCD_ShowChinese(53,148,"菜单",RED,WHITE,12,1);	
				LCD_ShowChinese(88,148,"管理",WHITE,WHITE,12,1);
		break ;
		
		
		case 12:
				
//				LCD_DrawRectangle (15,118,45,146,  WHITE);
//				LCD_DrawRectangle (50,118,80,146, WHITE) ;	
//					Delay_us(10);
//				LCD_DrawRectangle  (85,118,115,146, RED);
		
				LCD_ShowChinese(18,148,"设置",WHITE,WHITE,12,1);	
				LCD_ShowChinese(53,148,"菜单",WHITE,WHITE,12,1);	
				LCD_ShowChinese(88,148,"管理",RED,WHITE,12,1);
		break ;
		
	}
//	LCD_ShowChinese(18,148,"设置",BLUE,WHITE,12,0);	
//	LCD_ShowChinese(53,148,"菜单",BLUE,WHITE,12,0);	
//	LCD_ShowChinese(88,148,"管理",BLUE,WHITE,12,0);	
	condem=conde ;
}




//含参判断式选择
/**
 * @brief 第二界面面板，并改变索引
 * 
 */
void fujiemian_mianban(void)
{
	
	conde_two();
	if(conde != condem )
	{
		 ass=RTC_GetCounter()+20;
	}
	conde0=15+35*((conde/4-1)%3);
	conde1 =conde0 -35;
	conde2 =conde0 +35;
	//
	if(conde1<0)
	{
		conde1=85;
	}
	
	else if(conde2<0)
	{
		conde2=85;
	}	
	else if(conde2 >85)
	{
		conde2=15;
	}
	else if(conde1 >85)
	{
		conde1=15;
	}
	
	
	//
	if(S((conde/4-1),3)==0)
	{
		j=15+42*3;
	}
	else
	{
		j=15+42*(S((conde/4-1),3)-1);
		
	}
	
	//
	if(S((conde/4-1),3)==3)
	{
		i=15+42*0;
	}
	else
	{
		i=15+42*(S((conde/4-1),3)+1);	
	}
	
	//
	
	LCD_DrawRectangle (conde1,15+42*S((conde/4-1),3),conde1+30,15+42*S((conde/4-1),3)+28, WHITE);
	LCD_DrawRectangle (conde2,15+42*S((conde/4-1),3),conde2+30,15+42*S((conde/4-1),3)+28, WHITE) ;
	LCD_DrawRectangle (85,j,115,j+28, WHITE) ;
	LCD_DrawRectangle (50,j,80,j+28, WHITE) ;
	LCD_DrawRectangle (15,j,45,j+28, WHITE) ;				
	LCD_DrawRectangle (85,i,115,i+28, WHITE) ;
	LCD_DrawRectangle (50,i,80,i+28, WHITE) ;
	LCD_DrawRectangle (15,i,45,i+28, WHITE) ;			
	LCD_DrawRectangle (conde0,15+42*S((conde/4-1),3),conde0+30,15+42*S((conde/4-1),3)+28, RED);
	condem=conde ;
}



//switch简单语句
/**
 * @brief 界面选择显示框
 * 
 */
void fujiemian_mianban_switch(void)
{
	conde_two();
	
	if(conde != condem )
	{
		 ass=RTC_GetCounter()+20;
	}
	switch (conde)
	{
		case 4:
				LCD_ShowPicture(15,15,30,28,D1);
				LCD_ShowChinese(18,44,"小车",RED,WHITE,12,1);
				LCD_ShowPicture(50,15,30,28,B1);            
				LCD_ShowChinese(53,44,"温湿",WHITE,WHITE,12,1);
				LCD_ShowPicture(85,15,30,28,E1);            
				LCD_ShowChinese(88,44,"相册",WHITE,WHITE,12,1);	
		
				LCD_ShowString(18,57,"4",WHITE,WHITE,12,1);
				LCD_ShowString(53,57,"5",WHITE,WHITE,12,1);	
				LCD_ShowString(88,57,"6",WHITE,WHITE,12,1);
		
				LCD_ShowString(18,99,"7",WHITE,WHITE,12,1);
				LCD_ShowString(53,99,"8",WHITE,WHITE,12,1);	
				LCD_ShowString(88,99,"9",WHITE,WHITE,12,1);
		
	
		
				LCD_ShowString(18,145,"PREV",WHITE,WHITE,12,1);
				LCD_ShowString(53,145,"MENU",WHITE,WHITE,12,1);	
				LCD_ShowString(88,145,"NEXT",WHITE,WHITE,12,1);
		break;
		
		
		
		
		
			
		case 8:
				LCD_ShowPicture(15,15,30,28,D1);
				LCD_ShowChinese(18,44,"小车",WHITE,WHITE,12,1);
				LCD_ShowPicture(50,15,30,28,B1);            
				LCD_ShowChinese(53,44,"温湿",RED,WHITE,12,1);
				LCD_ShowPicture(85,15,30,28,E1);            
				LCD_ShowChinese(88,44,"相册",WHITE,WHITE,12,1);	
		
		
				LCD_ShowString(18,57,"4",WHITE,WHITE,12,1);
				LCD_ShowString(53,57,"5",WHITE,WHITE,12,1);	
				LCD_ShowString(88,57,"6",WHITE,WHITE,12,1);
		
				LCD_ShowString(18,99,"7",WHITE,WHITE,12,1);
				LCD_ShowString(53,99,"8",WHITE,WHITE,12,1);	
				LCD_ShowString(88,99,"9",WHITE,WHITE,12,1);
		

		
		
				LCD_ShowString(18,145,"PREV",WHITE,WHITE,12,1);
				LCD_ShowString(53,145,"MENU",WHITE,WHITE,12,1);	
				LCD_ShowString(88,145,"NEXT",WHITE,WHITE,12,1);
		break;
			
		case 12:
				LCD_ShowPicture(15,15,30,28,D1);
				LCD_ShowChinese(18,44,"小车",WHITE,WHITE,12,1);
				LCD_ShowPicture(50,15,30,28,B1);            
				LCD_ShowChinese(53,44,"温湿",WHITE,WHITE,12,1);
				LCD_ShowPicture(85,15,30,28,E1);            
				LCD_ShowChinese(88,44,"相册",RED,WHITE,12,1);	
		
				LCD_ShowString(18,57,"4",WHITE,WHITE,12,1);
				LCD_ShowString(53,57,"5",WHITE,WHITE,12,1);	
				LCD_ShowString(88,57,"6",WHITE,WHITE,12,1);
		
				LCD_ShowString(18,99,"7",WHITE,WHITE,12,1);
				LCD_ShowString(53,99,"8",WHITE,WHITE,12,1);	
				LCD_ShowString(88,99,"9",WHITE,WHITE,12,1);
		

		
		
				LCD_ShowString(18,145,"PREV",WHITE,WHITE,12,1);
				LCD_ShowString(53,145,"MENU",WHITE,WHITE,12,1);	
				LCD_ShowString(88,145,"NEXT",WHITE,WHITE,12,1);
		break;
			
		case 16:
								LCD_ShowPicture(15,15,30,28,D1);
				LCD_ShowChinese(18,44,"小车",WHITE,WHITE,12,1);
				LCD_ShowPicture(50,15,30,28,B1);            
				LCD_ShowChinese(53,44,"温湿",WHITE,WHITE,12,1);
				LCD_ShowPicture(85,15,30,28,E1);            
				LCD_ShowChinese(88,44,"相册",WHITE,WHITE,12,1);	
		
				LCD_ShowString(18,57,"4",RED,WHITE,12,1);
				LCD_ShowString(53,57,"5",WHITE,WHITE,12,1);	
				LCD_ShowString(88,57,"6",WHITE,WHITE,12,1);
		
				LCD_ShowString(18,99,"7",WHITE,WHITE,12,1);
				LCD_ShowString(53,99,"8",WHITE,WHITE,12,1);	
				LCD_ShowString(88,99,"9",WHITE,WHITE,12,1);
		

		
		
				LCD_ShowString(18,145,"PREV",WHITE,WHITE,12,1);
				LCD_ShowString(53,145,"MENU",WHITE,WHITE,12,1);	
				LCD_ShowString(88,145,"NEXT",WHITE,WHITE,12,1);



		break;	
		
		case 20:				LCD_ShowPicture(15,15,30,28,D1);
				LCD_ShowChinese(18,44,"小车",WHITE,WHITE,12,1);
				LCD_ShowPicture(50,15,30,28,B1);            
				LCD_ShowChinese(53,44,"温湿",WHITE,WHITE,12,1);
				LCD_ShowPicture(85,15,30,28,E1);            
				LCD_ShowChinese(88,44,"相册",WHITE,WHITE,12,1);	
		
				LCD_ShowString(18,57,"4",WHITE,WHITE,12,1);
				LCD_ShowString(53,57,"5",RED,WHITE,12,1);	
				LCD_ShowString(88,57,"6",WHITE,WHITE,12,1);
		
				LCD_ShowString(18,99,"7",WHITE,WHITE,12,1);
				LCD_ShowString(53,99,"8",WHITE,WHITE,12,1);	
				LCD_ShowString(88,99,"9",WHITE,WHITE,12,1);

		
		
				LCD_ShowString(18,145,"PREV",WHITE,WHITE,12,1);
				LCD_ShowString(53,145,"MENU",WHITE,WHITE,12,1);	
				LCD_ShowString(88,145,"NEXT",WHITE,WHITE,12,1);	break;
			
		case 24:
				LCD_ShowPicture(15,15,30,28,D1);
				LCD_ShowChinese(18,44,"小车",WHITE,WHITE,12,1);
				LCD_ShowPicture(50,15,30,28,B1);            
				LCD_ShowChinese(53,44,"温湿",WHITE,WHITE,12,1);
				LCD_ShowPicture(85,15,30,28,E1);            
				LCD_ShowChinese(88,44,"相册",WHITE,WHITE,12,1);	
		
				LCD_ShowString(18,57,"4",WHITE,WHITE,12,1);
				LCD_ShowString(53,57,"5",WHITE,WHITE,12,1);	
				LCD_ShowString(88,57,"6",RED,WHITE,12,1);
		
				LCD_ShowString(18,99,"7",WHITE,WHITE,12,1);
				LCD_ShowString(53,99,"8",WHITE,WHITE,12,1);	
				LCD_ShowString(88,99,"9",WHITE,WHITE,12,1);
		

		
		
				LCD_ShowString(18,145,"PREV",WHITE,WHITE,12,1);
				LCD_ShowString(53,145,"MENU",WHITE,WHITE,12,1);	
				LCD_ShowString(88,145,"NEXT",WHITE,WHITE,12,1);	break;	
			
		case 28:				LCD_ShowPicture(15,15,30,28,D1);
				LCD_ShowChinese(18,44,"小车",WHITE,WHITE,12,1);
				LCD_ShowPicture(50,15,30,28,B1);            
				LCD_ShowChinese(53,44,"温湿",WHITE,WHITE,12,1);
				LCD_ShowPicture(85,15,30,28,E1);            
				LCD_ShowChinese(88,44,"相册",WHITE,WHITE,12,1);	
		
				LCD_ShowString(18,57,"4",WHITE,WHITE,12,1);
				LCD_ShowString(53,57,"5",WHITE,WHITE,12,1);	
				LCD_ShowString(88,57,"6",WHITE,WHITE,12,1);
		
				LCD_ShowString(18,99,"7",RED,WHITE,12,1);
				LCD_ShowString(53,99,"8",WHITE,WHITE,12,1);	
				LCD_ShowString(88,99,"9",WHITE,WHITE,12,1);

		
		
				LCD_ShowString(18,145,"PREV",WHITE,WHITE,12,1);
				LCD_ShowString(53,145,"MENU",WHITE,WHITE,12,1);	
				LCD_ShowString(88,145,"NEXT",WHITE,WHITE,12,1);	break;	
			
		case 32:LCD_ShowPicture(15,15,30,28,D1);
				LCD_ShowChinese(18,44,"小车",WHITE,WHITE,12,1);
				LCD_ShowPicture(50,15,30,28,B1);            
				LCD_ShowChinese(53,44,"温湿",WHITE,WHITE,12,1);
				LCD_ShowPicture(85,15,30,28,E1);            
				LCD_ShowChinese(88,44,"相册",WHITE,WHITE,12,1);	
		
				LCD_ShowString(18,57,"4",WHITE,WHITE,12,1);
				LCD_ShowString(53,57,"5",WHITE,WHITE,12,1);	
				LCD_ShowString(88,57,"6",WHITE,WHITE,12,1);
		
				LCD_ShowString(18,99,"7",WHITE,WHITE,12,1);
				LCD_ShowString(53,99,"8",RED,WHITE,12,1);	
				LCD_ShowString(88,99,"9",WHITE,WHITE,12,1);
		

		
		
				LCD_ShowString(18,145,"PREV",WHITE,WHITE,12,1);
				LCD_ShowString(53,145,"MENU",WHITE,WHITE,12,1);	
				LCD_ShowString(88,145,"NEXT",WHITE,WHITE,12,1);	break;	
		
		case 36:
				LCD_ShowPicture(15,15,30,28,D1);
				LCD_ShowChinese(18,44,"小车",WHITE,WHITE,12,1);
				LCD_ShowPicture(50,15,30,28,B1);            
				LCD_ShowChinese(53,44,"温湿",WHITE,WHITE,12,1);
				LCD_ShowPicture(85,15,30,28,E1);            
				LCD_ShowChinese(88,44,"相册",WHITE,WHITE,12,1);	
		
				LCD_ShowString(18,57,"4",WHITE,WHITE,12,1);
				LCD_ShowString(53,57,"5",WHITE,WHITE,12,1);	
				LCD_ShowString(88,57,"6",WHITE,WHITE,12,1);
		
				LCD_ShowString(18,99,"7",WHITE,WHITE,12,1);
				LCD_ShowString(53,99,"8",WHITE,WHITE,12,1);	
				LCD_ShowString(88,99,"9",RED ,WHITE,12,1);
		
//				LCD_ShowString(18,141,"10",WHITE,WHITE,12,1);
//				LCD_ShowString(53,141,"11",WHITE,WHITE,12,1);	
//				LCD_ShowString(88,141,"12",WHITE,WHITE,12,1);
		
		
				LCD_ShowString(18,145,"PREV",WHITE,WHITE,12,1);
				LCD_ShowString(53,145,"MENU",WHITE,WHITE,12,1);	
				LCD_ShowString(88,145,"NEXT",WHITE,WHITE,12,1);	break;
			
		case 40:
							LCD_ShowPicture(15,15,30,28,D1);
				LCD_ShowChinese(18,44,"小车",WHITE,WHITE,12,1);
				LCD_ShowPicture(50,15,30,28,B1);            
				LCD_ShowChinese(53,44,"温湿",WHITE,WHITE,12,1);
				LCD_ShowPicture(85,15,30,28,E1);            
				LCD_ShowChinese(88,44,"相册",WHITE,WHITE,12,1);	
				
				LCD_ShowString(18,57,"4",WHITE,WHITE,12,1);
				LCD_ShowString(53,57,"5",WHITE,WHITE,12,1);	
				LCD_ShowString(88,57,"6",WHITE,WHITE,12,1);
		
				LCD_ShowString(18,99,"7",WHITE,WHITE,12,1);
				LCD_ShowString(53,99,"8",WHITE,WHITE,12,1);	
				LCD_ShowString(88,99,"9",WHITE,WHITE,12,1);
		

		
				LCD_ShowString(18,145,"PREV",RED,WHITE,12,1);
				LCD_ShowString(53,145,"MENU",WHITE,WHITE,12,1);	
				LCD_ShowString(88,145,"NEXT",WHITE,WHITE,12,1);
		break;
			
		case 44:
							LCD_ShowPicture(15,15,30,28,D1);
				LCD_ShowChinese(18,44,"小车",WHITE,WHITE,12,1);
				LCD_ShowPicture(50,15,30,28,B1);            
				LCD_ShowChinese(53,44,"温湿",WHITE,WHITE,12,1);
				LCD_ShowPicture(85,15,30,28,E1);            
				LCD_ShowChinese(88,44,"相册",WHITE,WHITE,12,1);	
		
				LCD_ShowString(18,57,"4",WHITE,WHITE,12,1);
				LCD_ShowString(53,57,"5",WHITE,WHITE,12,1);	
				LCD_ShowString(88,57,"6",WHITE,WHITE,12,1);
		
				LCD_ShowString(18,99,"7",WHITE,WHITE,12,1);
				LCD_ShowString(53,99,"8",WHITE,WHITE,12,1);	
				LCD_ShowString(88,99,"9",WHITE,WHITE,12,1);
		

		
				LCD_ShowString(18,145,"PREV",WHITE,WHITE,12,1);
				LCD_ShowString(53,145,"MENU",RED,WHITE,12,1);	
				LCD_ShowString(88,145,"NEXT",WHITE,WHITE,12,1);
		break;
			
		case 48:
							LCD_ShowPicture(15,15,30,28,D1);
				LCD_ShowChinese(18,44,"小车",WHITE,WHITE,12,1);
				LCD_ShowPicture(50,15,30,28,B1);            
				LCD_ShowChinese(53,44,"温湿",WHITE,WHITE,12,1);
				LCD_ShowPicture(85,15,30,28,E1);            
				LCD_ShowChinese(88,44,"相册",WHITE,WHITE,12,1);	
		
				LCD_ShowString(18,57,"4",WHITE,WHITE,12,1);
				LCD_ShowString(53,57,"5",WHITE,WHITE,12,1);	
				LCD_ShowString(88,57,"6",WHITE,WHITE,12,1);
		
				LCD_ShowString(18,99,"7",WHITE,WHITE,12,1);
				LCD_ShowString(53,99,"8",WHITE,WHITE,12,1);	
				LCD_ShowString(88,99,"9",WHITE,WHITE,12,1);
		

	
				LCD_ShowString(18,145,"PREV",WHITE,WHITE,12,1);
				LCD_ShowString(53,145,"MENU",WHITE,WHITE,12,1);	
				LCD_ShowString(88,145,"NEXT",RED,WHITE,12,1);
		break;
		
		
		
	}
	condem=conde ;
}



/**
 * @brief 车界面面板
 * 
 */
void carjiemian_mianban(void)
{
	
	conde_three();

	if(conde != condem )
	{
		 ass=RTC_GetCounter()+daiji_time[0];
	}
	switch (conde )
	{
		case 4:
	
		LCD_DrawRectangle(10,15,118,43,RED  );	
		LCD_DrawRectangle(10,45,118,73,WHITE );
		LCD_DrawRectangle(10,80,118,108,WHITE );	
		LCD_DrawRectangle(10,115,118,143,WHITE );
		LCD_ShowChinese(36,144,"碾碎他们",BLUE,WHITE ,16,0);
		break ;

		case 8:
	    
		LCD_DrawRectangle(10,15,118,43, WHITE );	
		LCD_DrawRectangle(10,45,118,73,RED );
		LCD_DrawRectangle(10,80,118,108,WHITE );	
		LCD_DrawRectangle(10,115,118,143,WHITE );
		LCD_ShowChinese(36,144,"飙车开始",BLUE,WHITE ,16,0);
		break ;

		case 12:
	    
		LCD_DrawRectangle(10,15,118,43, WHITE );	
		LCD_DrawRectangle(10,45,118,73, WHITE);
		LCD_DrawRectangle(10,80,118,108, RED);	
		LCD_DrawRectangle(10,115,118,143,WHITE );
		LCD_ShowChinese(36,144,"闪瞎他们",BLUE,WHITE ,16,0);
		break ;

		case 16:
	
		
		LCD_DrawRectangle(10,15,118,43,  WHITE);	
		LCD_DrawRectangle(10,45,118,73,WHITE );
		LCD_DrawRectangle(10,80,118,108,WHITE );	
		LCD_DrawRectangle(10,115,118,143, RED);
		LCD_ShowChinese(36,144,"退出驾驶",YELLOW,BLACK ,16,0);

		break;

	}		
	condem =conde;
}

/**
 * @brief 温湿度界面面板
 * 
 */
void DHjiemian(void )
{

	conde_one();
	if(conde != condem )
	{
		 ass=RTC_GetCounter()+daiji_time[0];
	}

	switch(conde)
	{
		
		case 4:	
				LCD_ShowChinese(15,125,"存入",RED,WHITE ,16,1);
				LCD_ShowChinese(50,125,"读取",BRED,WHITE ,16,1);
				LCD_ShowChinese(85,125,"页",BRED,WHITE ,16,1);
									
									
		break ;                     
		case 8:                     
				LCD_ShowChinese(15,125,"存入",BRED,WHITE ,16,1);
				LCD_ShowChinese(50,125,"读取",RED,WHITE ,16,1);
				LCD_ShowChinese(85,125,"页",BRED,WHITE ,16,1);
		break ;                     
									
									
		case 12:                    
									
				LCD_ShowChinese(15,125,"存入",BRED,WHITE ,16,1);
				LCD_ShowChinese(50,125,"读取",BRED,WHITE ,16,1);
				LCD_ShowChinese(85,125,"页",RED,WHITE ,16,1);
		break ;
		
	}
		condem =conde;
	
	
}





/**
 * @brief 设置界面面板
 * 
 */
void SETjimian(void )
{
	conde_three();

	if(conde != condem )
	{
		 ass=RTC_GetCounter()+daiji_time[0];
	}
	switch (conde )
	{
		case 4:
	
		LCD_ShowChinese(36,17,"密码",RED,WHITE ,16,1);
		LCD_ShowChinese(36,47,"待机时间",WHITE,WHITE ,16,1);
		LCD_ShowString(36,82,"X",WHITE ,WHITE ,16,1);
		LCD_ShowString(36,117,"X",WHITE,WHITE ,16,1);
//		LCD_DrawRectangle(10,15,118,43,RED  );	
//		LCD_DrawRectangle(10,45,118,73,WHITE );
//		LCD_DrawRectangle(10,80,118,108,WHITE );	
//		LCD_DrawRectangle(10,115,118,143,WHITE );
		
		break ;

		case 8:
	    LCD_ShowChinese(36,17,"密码",WHITE,WHITE ,16,1);
		LCD_ShowChinese(36,47,"待机时间",RED,WHITE ,16,1);
		LCD_ShowString(36,82,"X",WHITE ,WHITE ,16,1);
		LCD_ShowString(36,117,"X",WHITE,WHITE ,16,1);

		
		break ;

		case 12:
		LCD_ShowChinese(36,17,"密码",WHITE,WHITE ,16,1);
		LCD_ShowChinese(36,47,"待机时间",WHITE,WHITE ,16,1);
	    LCD_ShowString(36,82,"X",RED ,WHITE ,16,1);
		LCD_ShowString(36,117,"X",WHITE,WHITE ,16,1);

		break ;

		case 16:
		LCD_ShowChinese(36,17,"密码",WHITE,WHITE ,16,1);
		LCD_ShowChinese(36,47,"待机时间",WHITE,WHITE ,16,1);
		LCD_ShowString(36,82,"X",WHITE,WHITE ,16,1);
		LCD_ShowString(36,117,"X",RED,WHITE ,16,1);
		break;

	}		
	condem =conde;
}
	
	
	
	
	
	
	
	
	


/**
 * @brief 待机界面面板
 * 
 */
void standjimian(void)
{
	conde_one();
	if(conde != condem )
	{
		 ass=RTC_GetCounter()+20;
	}
	Delay_ms(10);
	
	switch(conde)
	{
		
		case 4:	

				LCD_ShowChinese(16,119,"修改",RED,WHITE,16,1);	
				LCD_ShowChinese(51,119,"保存",BRED,WHITE,16,1);	
				LCD_ShowChinese(86,119,"退出",BRED,WHITE,16,1);	   
	
		break ;
		case 8:
				LCD_ShowChinese(16,119,"修改",BRED ,WHITE,16,1);	
				LCD_ShowChinese(51,119,"保存",RED,WHITE,16,1);	
				LCD_ShowChinese(86,119,"退出",BRED,WHITE,16,1);	
		break ;

		
		case 12:
				LCD_ShowChinese(16,119,"修改",BRED,WHITE,16,1);	
				LCD_ShowChinese(51,119,"保存",BRED,WHITE,16,1);	
				LCD_ShowChinese(86,119,"退出",RED ,WHITE,16,1);	
		break ;
		
	}
	
	condem=conde ;
	
	
}


/**
 * @brief 密码界面面板索引
 * 
 * @param a 无效
 */
void mimajiemian(uint16_t a )
{

	
	conde_three();
	
	if(conde != condem )
	{
		 ass=RTC_GetCounter()+daiji_time[0];
	}

	switch (conde )
	{
		case 4:
			

		LCD_ShowIntNum(70,150,mima[3],1,BLUE,LIGHTBLUE ,12);
		LCD_ShowIntNum(64,150,mima[2],1,BLUE,LIGHTBLUE ,12);
		LCD_ShowIntNum(58,150,mima[1],1,BLUE,LIGHTBLUE ,12);
		LCD_ShowIntNum(52,150,mima[0],1,RED,LIGHTBLUE ,12);	
		LCD_ShowString(54,2,"YES",WHITE  ,WHITE ,12,1);
		
		break ;
		
		
			
		case 8:
		LCD_ShowIntNum(70,150,mima[3],1,BLUE  ,LIGHTBLUE ,12);
		LCD_ShowIntNum(64,150,mima[2],1, BLUE,LIGHTBLUE ,12);
		LCD_ShowIntNum(58,150,mima[1],1,RED ,LIGHTBLUE ,12);
		LCD_ShowIntNum(52,150,mima[0],1, BLUE,LIGHTBLUE ,12);
		LCD_ShowString(54,2,"YES",WHITE  ,WHITE ,12,1);
		
		break;
		
			
		case 12:
		LCD_ShowIntNum(70,150,mima[3],1, BLUE ,LIGHTBLUE ,12);
		LCD_ShowIntNum(64,150,mima[2],1,RED  ,LIGHTBLUE ,12);
		LCD_ShowIntNum(58,150,mima[1],1,BLUE ,LIGHTBLUE ,12);
		LCD_ShowIntNum(52,150,mima[0],1,BLUE ,LIGHTBLUE ,12);
		LCD_ShowString(54,2,"YES",WHITE  ,WHITE ,12,1);
		
		break;
			
		case 16:
		LCD_ShowIntNum(70,150,mima[3],1, RED ,LIGHTBLUE ,12);
		LCD_ShowIntNum(64,150,mima[2],1,BLUE ,LIGHTBLUE ,12);
		LCD_ShowIntNum(58,150,mima[1],1,BLUE ,LIGHTBLUE ,12);
		LCD_ShowIntNum(52,150,mima[0],1,BLUE ,LIGHTBLUE ,12);
		LCD_ShowString(54,2,"YES",WHITE  ,WHITE ,12,1);
		
		break;
		
		case 20:
		LCD_ShowIntNum(70,150,mima[3],1,BLUE  ,LIGHTBLUE ,12);
		LCD_ShowIntNum(64,150,mima[2],1,BLUE ,LIGHTBLUE ,12);
		LCD_ShowIntNum(58,150,mima[1],1,BLUE ,LIGHTBLUE ,12);
		LCD_ShowIntNum(52,150,mima[0],1, BLUE,LIGHTBLUE ,12);
		LCD_ShowString(54,2,"YES",RED  ,RED ,12,1);
		
		break;
	}
	condem =conde;
	
	
}

/**
 * @brief 密码选择
 * 
 * @param a 索引
 */
void  mima_key(uint16_t a)
{
	if(key1()==1)
	{
		 ass=RTC_GetCounter()+daiji_time[0];	
		mima[a/4-1]+=1;	
		 if(mima[a/4-1]>9)
		{
			mima[a/4-1]=0;	
		}
	}
	else if(key0()==1)
	{
		ass=RTC_GetCounter()+10;	
		mima[a/4-1]-=1;
		if((int8_t)mima [a/4-1]<0)
		{
			mima[a/4-1]=9;
		}
	}
}


/**
 * @brief 确认密码
 * 
 * @return uint16_t 成功1，失败0
 */
uint16_t  mima_P(void )
{

	
	
	if(mima[0]==ma[0] & mima[1]==ma[1] & mima[2]==ma[2] & mima[3]==ma[3])
	{
		
		return 1;
	}
	else
	{
		return 0;
		
	}
	
	
	
	
	
}




















